<html>
<head><meta charset="utf-8"><title>macro_rules with parens · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/macro_rules.20with.20parens.html">macro_rules with parens</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220841256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/macro_rules%20with%20parens/near/220841256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/macro_rules.20with.20parens.html#220841256">(Dec 24 2020 at 01:08)</a>:</h4>
<p>rust-analyzer gets quite confused about macros defined with parenthesis delimiters, although rust has no problems:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="fm">macro_rules!</span><span class="w"> </span><span class="n">foo</span><span class="p">(</span><span class="w"></span>
<span class="w">    </span><span class="p">()</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="fm">println!</span><span class="p">(</span><span class="s">"hello"</span><span class="p">)}</span><span class="w"></span>
<span class="p">);</span><span class="w"></span>
</code></pre></div>



<a name="220856645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/macro_rules%20with%20parens/near/220856645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/macro_rules.20with.20parens.html#220856645">(Dec 24 2020 at 08:30)</a>:</h4>
<p>looks like that was overlooked in a recent refactor</p>



<a name="220859952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/macro_rules%20with%20parens/near/220859952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/macro_rules.20with.20parens.html#220859952">(Dec 24 2020 at 09:53)</a>:</h4>
<p>Oh, that's allowed? Wow</p>



<a name="220859996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/macro_rules%20with%20parens/near/220859996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/macro_rules.20with.20parens.html#220859996">(Dec 24 2020 at 09:54)</a>:</h4>
<p>Should be easy to fix though</p>



<a name="220860121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/macro_rules%20with%20parens/near/220860121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/macro_rules.20with.20parens.html#220860121">(Dec 24 2020 at 09:57)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/pull/7027/">https://github.com/rust-analyzer/rust-analyzer/pull/7027/</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>